package com.ms.game.common.container;

import java.util.ArrayList;

import com.xpec.c4.game.utility.GameUtility;

public class RobotNickName 
{
	private static RobotNickName instance;
	
	private ArrayList<String> perfixs;
	
	private ArrayList<String> maleNames;
	
	private ArrayList<String>femaleNames;
	
	
	
/**
 * 姓
 * @return
 */
	public ArrayList<String> getPerfixs() {
		return perfixs;
	}

	public void setPerfixs(ArrayList<String> perfixs) {
		this.perfixs = perfixs;
	}

	/**
	 * 男名
	 * @return
	 */
	public ArrayList<String> getMaleNames() {
		return maleNames;
	}

	public void setMaleNames(ArrayList<String> maleNames) {
		this.maleNames = maleNames;
	}

	
	/**
	 * 女名
	 * @return
	 */
	public ArrayList<String> getFemaleNames() {
		return femaleNames;
	}

	public void setFemaleNames(ArrayList<String> femaleNames) {
		this.femaleNames = femaleNames;
	}

	public static RobotNickName getInstance() {
		return instance;
	}

	public static void setInstance(RobotNickName instance) {
		RobotNickName.instance = instance;
	}
	
	/**
	 * 讀取匿稱
	 * @param male
	 * @return
	 */
	public String getNickName(boolean male)
	{
		StringBuilder builder = new StringBuilder();
		
		String perfix = "";
		String name = "";
		
		//姓
		if(perfixs!=null && perfixs.size() >0)
		{
			perfix =perfixs.get(GameUtility.randomInt(0, perfixs.size()-1));
		}
		
		//名
		ArrayList<String> list = (male)? maleNames:femaleNames;
		if(list!=null && list.size() > 0)
		{
			name = list.get(GameUtility.randomInt(0, list.size()-1));
		}
	
		
		builder.append(perfix);
		builder.append(name);
		
		return builder.toString();
	}
	
	
}
